﻿<!--
///////////////////////////////////////////////////////////////////////////////
//  
// HybridClock.xaml (original:  clock.xaml)
// 
// 2008 Microsoft Corporation. All Rights Reserved.
//
// This file is licensed as part of the Silverlight 2 SDK, for details look here: http://go.microsoft.com/fwlink/?LinkID=111970&clcid=0x409
//
////////////////////////////////////////////////////////////////////////////////////////// 
// Modified by Dr. Alexander Bell, USA (www.alexanderbell.us) on 10/18/2008
// Added: Clock re-sizing and scale animation
//        Clock face layout components
//        Logo
//        Digital Clock with Date/Time
// Version: 2.0
//
// Modified by Dr. Alexander Bell, USA (www.alexanderbell.us) on 10/26/2008
// Layout correction
// Version: 2.01
//////////////////////////////////////////////////////////////////////////////////////////
-->

<Canvas Opacity="0" xmlns="http://schemas.microsoft.com/client/2007" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="ClockCanvas" >

  <!-- MOD AB 10/08/2008 -->
  <Canvas.RenderTransform>
    <ScaleTransform x:Name="scaleClock" ScaleX="1" ScaleY="1" />
  </Canvas.RenderTransform >
  
  <Canvas.Triggers>
        <EventTrigger RoutedEvent="Canvas.Loaded">
            <EventTrigger.Actions>
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation x:Name="hourAnimation" Storyboard.TargetName="hourHandTransform" Storyboard.TargetProperty="Angle" From="180" To="540" Duration="12:0:0" RepeatBehavior="Forever"/>
                        <DoubleAnimation x:Name="minuteAnimation" Storyboard.TargetName="minuteHandTransform" Storyboard.TargetProperty="Angle" From="180" To="540" Duration="1:0:0" RepeatBehavior="Forever"/>
                        <DoubleAnimation x:Name="secondAnimation" Storyboard.TargetName="secondHandTransform" Storyboard.TargetProperty="Angle" From="180" To="540" Duration="0:1:0" RepeatBehavior="Forever"/>
                        <!-- Animated Opacity -->
                        <DoubleAnimation Storyboard.TargetName="ClockCanvas" Storyboard.TargetProperty="Opacity" From="0" To="0.7" Duration="0:0:1"/>
                        <!-- MOD AB 10/08/2008 -->
                        <!-- Animated Resizing-->
                        <DoubleAnimation x:Name="scaleXanimation" Storyboard.TargetName="scaleClock" Storyboard.TargetProperty="ScaleX" From="0" To="1" Duration="0:0:1"/>
                        <DoubleAnimation x:Name="scaleYanimation" Storyboard.TargetName="scaleClock" Storyboard.TargetProperty="ScaleY" From="0" To="1" Duration="0:0:1"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
    </Canvas.Triggers>

  <!-- MOD AB 10/08/2008 -->
  <!-- Drop shadow 
    <Path Data="M 157, 5 a 150,150 0 1,0 1,0 z">
        <Path.Fill>
            <SolidColorBrush Color="Black" Opacity="0.3"/>
        </Path.Fill>
    </Path>
    -->
  
  <!-- Clock bezel -->
    <Path Data="M 150, 0 a 150,150 0 1,0 1,0 z" Fill="Maroon" />
    <Path Data="M 150, 1 a 149,149 0 1,0 1,0 z">
        <Path.Fill>
            <LinearGradientBrush>
                <LinearGradientBrush.GradientStops>
                        <GradientStop Color="Maroon" Offset="0.05"/>
                        <GradientStop Color="#333333" Offset="0.95"/>
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </Path.Fill>
    </Path>
  
    <Path Data="M 150, 15 a 135,135 0 1,0 1,0 z" Fill="Black" Opacity="1"/>
     <Path Data="M 150, 16 a 134,134 0 1,0 1,0 z" Opacity="1">
        <Path.Fill>
            <LinearGradientBrush>
                <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#333333" Offset="0.05"/>
                        <GradientStop Color="Silver" Offset="0.95"/>
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </Path.Fill>
    </Path>
    
  <!-- Clock face -->
    <Path Data="M 150, 23 a 127,127 0 1,0 1,0 z" Fill="Black" Opacity="1"/>

  <!-- Center ring -->
  <Path Data="M 150, 133 a 12,12 0 1,0 1,0 z" Fill="Olive"/>
  <Path Data="M 150, 136 a 9,9 0 1,0 1,0 z" Fill="Black"/>


  <!-- MOD AB 10/08/2008 -->
  <!-- Mark 3  -->
  <!--Path Stroke ="Yellow" StrokeThickness="8" Data="M 265, 145 h -8" /-->
  <Polygon Points="255,145 270,135 270,155 255,145">
    <Polygon.Fill>
      <SolidColorBrush Color="Yellow" />
    </Polygon.Fill>
  </Polygon>


  <!-- MOD AB 10/08/2008 -->
  <!-- Mark 6 -->
  <!-- Path Stroke ="Yellow" StrokeThickness="8" Data="M 150, 255 v 8" /-->
    <Polygon Points="152,255 162,270 142,270 152,255">
    <Polygon.Fill>
      <SolidColorBrush Color="Yellow" />
    </Polygon.Fill>
  </Polygon>

  <!-- MOD AB 10/08/2008 -->
  <!-- Mark 9 -->
  <!--Path Stroke ="Yellow" StrokeThickness="8" Data="M 35, 145 h 8" /-->
  <Polygon Points="45,145 30,135 30,155 45,145">
    <Polygon.Fill>
      <SolidColorBrush Color="Yellow" />
    </Polygon.Fill>
  </Polygon>
  

  <!-- MOD AB 10/08/2008 -->
  <!-- Mark 12 -->
  <Path Data="M 150, 35 a 11,11 0 1,0 1,0 z" Fill="Yellow"/>


  <!-- Hour hand -->
    <Path Data="M -4, 16 l 3 40 3 0 2 -40 z" Fill="Yellow">
        <Path.RenderTransform>
            <TransformGroup>
                <RotateTransform x:Name="hourHandTransform" Angle="180"/>
                <TranslateTransform X="150.5" Y="145"/>
            </TransformGroup>
        </Path.RenderTransform>
    </Path>
    
  <!-- Minute hand -->
    <Path Data="M -4, 16 l 3 70 3 0 2 -70 z" Fill="Yellow">
        <Path.RenderTransform>
            <TransformGroup>
                <RotateTransform x:Name="minuteHandTransform" Angle="180"/>
                <TranslateTransform X="150.5" Y="145"/>
            </TransformGroup>
        </Path.RenderTransform>
    </Path>
    
  <!-- Second hand -->
    <Path Data="M -1, 16 l 0 70 2 0 0 -70 z" Fill="Red">
        <Path.RenderTransform>
            <TransformGroup>
                <RotateTransform x:Name="secondHandTransform" Angle="180"/>
                <TranslateTransform X="150.5" Y="145"/>
            </TransformGroup>
        </Path.RenderTransform>
    </Path>

  <!-- MOD AB 10/08/2008 -->
  <TextBlock x:Name="clockLogo"
            FontFamily ="Calibri"
            FontWeight="Light"
            FontSize="16"
            Foreground="Silver"
            Opacity="0.5"
            Canvas.Top="70"
            Canvas.Left="115"
            Text="Alex Bell">
  </TextBlock>

  <!-- MOD AB 10/08/2008 -->
  <TextBlock x:Name="dTime"
          FontFamily ="Calibri"
          FontSize="14"
          Foreground="Olive"
          Opacity="0.5"
          Canvas.Top="200"
          Canvas.Left="110"
          Loaded ="digiTimeSilverlight"
          Text="">
  </TextBlock>

  <!-- MOD AB 10/08/2008 -->
  <TextBlock x:Name="dDate"
         FontFamily ="Calibri"
         FontSize="14"
         Foreground="Olive"
         Opacity="0.5"
         Canvas.Top="220"
         Canvas.Left="110"
         Loaded ="digiDateSilverlight"
         Text="">
  </TextBlock>
  
</Canvas>

